package com.anyi.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;

/**
 * <p>
 * 
 * </p>
 *
 * @author anyi
 * @since 2022-04-14
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("m_article")
@ToString
public class Article implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    private Integer likeCounts;

    @JsonFormat(pattern = "yyyy-MM-dd hh:MM")
    private LocalDateTime createDate;

    @NotBlank(message = "概述不能为空")
    private String summary;

    @NotBlank(message = "标题不能为空")
    private String title;

    private Integer viewCounts;

    private Long authorId;

    @NotBlank(message = "内容不能为空")
    private String context;

    private Integer categoryId;
}
